Skip to main content

Disconnect

AutomatR.PostgreSQL.Database.Disconnect

The "Disconnect" activity in AutomatR allows you to gracefully disconnect from a specified PostgreSQL database, closing the database connection. This activity is essential for maintaining a clean and organized workflow, ensuring proper resource management.

Properties

NameDescription
Input
ConnectionProvide an NpgsqlConnection variable that represents the connection to the PostgreSQL database. This variable is typically obtained from the "Connect" activity. NpgsqlConnection variables containing the connection to be disconnected.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Disconnect" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Example: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.

How to use:

  1. Drag and drop the "Disconnect" activity onto the workflow.
  2. Configure the properties by specifying the NpgsqlConnection variable obtained from the "Connect" activity.
  3. Optionally, configure the delay.
  4. Execute the workflow to gracefully disconnect from the specified PostgreSQL database.

Example: Consider an example where the "Disconnect" activity is used to disconnect from a PostgreSQL database:

Disconnect:
Delay: 2
Connection: myDBConnection

In this example, the activity gracefully disconnects from the PostgreSQL database represented by the NpgsqlConnection variable "myDBConnection" with a 2-second delay. The connection is closed, and a success message is logged for reference.